package cn.jiyun.controller;

import cn.jiyun.config.UserProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

@RestController
public class UserController implements Serializable {

    @Autowired
    private UserProperties userProperties;

    @GetMapping("/getUser")
    public Map<String, Object> getUser() {
        Map<String, Object> map = new HashMap<>();
        map.put("username", userProperties.getUsername());
        map.put("password", userProperties.getPassword());
        map.put("age", userProperties.getAge());
        map.put("hobby", userProperties.getHobby());
        return map;
    }

}
